using System;
using System.Collections.Generic;
using System.Text;
using DTO;
using DAO;
using System.Data;

namespace BUS
{
	/// <summary> 
	///Author: nnamthach@gmail.com 
	/// <summary>
    public class zTableFieldControl
    {
		#region Local Variable
        private zTableFieldDataAccess _zTableFieldDAO;
		#endregion Local Variable
		
		#region Method
        public zTableFieldControl()
        {
            _zTableFieldDAO = new zTableFieldDataAccess();
        }
		
        public zTableFieldInfo Get_zTableField(
			Int32 TableFieldID
		, ref string sErr)
        {
            return _zTableFieldDAO.Get_zTableField(
			TableFieldID
			, ref sErr);
        }
		
        public DataTable GetAll_zTableField(ref string sErr)
        {
            return _zTableFieldDAO.GetAll_zTableField(ref sErr);
        }

        public DataTable Get_zTableName(string TableName, ref string sErr)
        {
            return _zTableFieldDAO.Get_zTableName(TableName, ref sErr);
        }
        public DataTable Get_zTableName(string TableName,string FormName, ref string sErr)
        {
            return _zTableFieldDAO.Get_zTableName(TableName,FormName, ref sErr);
        }
		
        public Int32 Add_zTableField(zTableFieldInfo obj, ref string sErr)
        {
            return _zTableFieldDAO.Add_zTableField(obj, ref sErr);
        }
		
        public string Update_zTableField(zTableFieldInfo obj)
        {
            return _zTableFieldDAO.Update_zTableField(obj);
        }
		
        public string Delete_zTableField(
			Int32 TableFieldID
		)
        {
            return _zTableFieldDAO.Delete_zTableField(
			TableFieldID
			);
        }  
        public Boolean IsExist_zTableField(
			Int32 TableFieldID
		)
        {
            return _zTableFieldDAO.IsExist_zTableField(
			TableFieldID
			);
        } 
		
      /*  public string Delete_zTableField(String arrID)
        {
            string kq = "";
            string[] arrStrID = arrID.Split(',');
            foreach (string strID in arrStrID)
            {
                if (strID != "")
                {
                    int ID = Convert.ToInt32(strID);
                    kq += _zTableFieldDAO.Delete_zTableField(ID);
                }
            }
            return kq;
        } */
		
        public DataTable Search(String columnName, String columnValue, String condition, ref String sErr)
        {           
            return _zTableFieldDAO.Search(columnName, columnValue, condition, ref  sErr);
        }
        
		#endregion Method


        public object Get_Combobox(string BoxType, ref string sErr)
        {
            return _zTableFieldDAO.Get_Combobox(BoxType,ref sErr);
        }
        public object Get_ComboboxField(string TableName, ref string sErr)
        {
            return _zTableFieldDAO.Get_ComboboxField(TableName, ref sErr);
        }

        public DataTable GetRuleSet(string RuleSet, ref string sErr)
        {
            return _zTableFieldDAO.GetRuleSet(RuleSet, ref sErr); 
        }

        public DataTable GetRuleSet(string TableName, string RuleSet, ref string sErr)
        {
            return _zTableFieldDAO.GetRuleSet(TableName,RuleSet, ref sErr); 
        }
    }
}
